package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type RedisConfig struct {
	Password string
	Host     string
	Port     int
	DbName   int
}
type JwtConfig struct {
	SecretKey string
	Seconds   int64
}
type UploadConfig struct {
	Endpoint        string
	AccessKeyID     string
	AccessKeySecret string
	Examplebucket   string
	ImgUrl          string
}
type AppConfig struct {
	RedisConfig
	JwtConfig
	UploadConfig
}

var AppConf AppConfig

func InitConfig() {
	viper.SetConfigFile("../class_bff/appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
	fmt.Println(AppConf)
}
